package cn.zyjblogs.netty.dubborpc.customer;

import cn.zyjblogs.netty.dubborpc.constant.CommonConstant;
import cn.zyjblogs.netty.dubborpc.netty.NettyClient;
import cn.zyjblogs.netty.dubborpc.publicinterface.HelloService;

import java.util.Scanner;

public class ClientBootStrap {
    public static void main(String[] args) throws InterruptedException {
        NettyClient customer = new NettyClient();
        //创建代理对象
        HelloService service = (HelloService) customer.getBean(HelloService.class, CommonConstant.FRE);
        //通过代理对象调用服务提供者的方法（服务）
        while (true) {
            Thread.sleep(4 * 1000);
            String res = service.hello("你好 ~~~~");
            System.out.println(res);
        }
    }
}
